package com.bj58.move;

import java.util.HashMap;
import java.util.Map;

public class Cate2XiaozhiweiMapperTemplate{

	private static final Map< Integer, String > cmc2xiaozhiMap = new HashMap< Integer, String >();
	private static final Map< String, Integer > xiaozhiwei2cateMap = new HashMap< String, Integer >();
	private static final Map< String, Integer > xiaozhiwei2displayMap = new HashMap< String, Integer >();
	private static final Map< Integer, Integer > second2Xiaozhiwei = new HashMap< Integer, Integer >();

	static{
		/** replace **/
	}

	/**
	 * 输入一个三级类别的归属id，返回一个二级类别+xiaozhiwei字符串，如果没有找到返回null<br>
	 * 格式:cateid=secondcateid&paramXXX=实例值
	 * 
	 * @param cateid
	 * @return
	 */
	public static String getXiaozhiCondtion( int cateid ){

		String xiaoCondition = cmc2xiaozhiMap.get( cateid );
		return xiaoCondition;
	}

	public static int getThirdCateid( int secondCateid, String xiaozhiwei ){

		try{
			String key = "cateid=" + secondCateid + "&xiaozhiwei=" + xiaozhiwei;
			return xiaozhiwei2cateMap.get( key );
		}
		catch( Exception ex ){
			return -1;
		}
	}

	/**
	 * 输入一个二级类别和一个xiaozhiwei实例值,返回一个三级类别表现id,如果没有找到返回-1
	 * 
	 * @param secondCateid
	 * @param xiaozhiwei
	 * @return
	 */
	public static int getThirdDispcateid( int secondCateid, String xiaozhiwei ){

		try{
			String key = "cateid=" + secondCateid + "&xiaozhiwei=" + xiaozhiwei;
			return xiaozhiwei2displayMap.get( key );
		}
		catch( Exception ex ){
			return -1;
		}
	}

	/**
	 * 通过二级类别获得小职位单元参数ID
	 * 
	 * @param secondCateid
	 * @return
	 */
	public static int getXiaozhiweiParamId( int secondCateid ){

		try{
			return second2Xiaozhiwei.get( secondCateid );
		}
		catch( Exception ex ){
			return -1;
		}
	}
}
